import Layout from '../components/Layout.vue'
import BackStageLayout from '../components/BackStage/BackStageLayout.vue'

let routes = [
    {
        name: 'Layout',
        title: '布局框架',
        path: '/',
        component: Layout,
        redirect: {
            name: 'ArticleInfo',
            title: '文章信息',
            path: 'articleinfo',
        },
        children: [
            {
                name: 'ArticleInfo',
                title: '文章信息',
                path: 'articleinfo',
                component: () => import('../components/Views/ArticleInfo.vue')

            },
            {
                name:'ArticleDetails',
                title:'文章详情',
                path:'articledetails',
                component:()=>import('../components/Views/ArticleDetails.vue')
            },
            
        ],
    },
    {
        name: 'BackStage',
        title: '后台管理',
        path: '/backstage',
        component: BackStageLayout,
        meta:{requireAuth:true},
        // redirect:{path:'userinfo'},
        children: [
            {
                name: 'UserManagement',
                title: '用户管理',
                path: 'userinfo',
                meta:{requireAuth:true},
                component: () => import('../components/BackStage/Views/UserManagement.vue')
            },
            {
                
                    name: 'Editor',
                    title: '富文本编辑器',
                    path: 'editor',
                    meta:{requireAuth:true},
                    component: () => import('../components/Views/Editor.vue')
    
                
            },
            {
                name: 'ArticleManagement',
                title: '文章管理',
                path: 'articleinfo',
                meta:{requireAuth:true},
                component: () => import('../components/BackStage/Views/ArticleManagement.vue')
            },
            {
                name: 'Carousel',
                title: '轮播图设置',
                path: 'Carousel',
                meta:{requireAuth:true},
                component: () => import('../components/BackStage/Views/Carousel.vue')
            },
            {
                name: 'Recommend',
                title: '推荐文章',
                path: 'Recommend',
                meta:{requireAuth:true},
                component: () => import('../components/BackStage/Views/Recommend.vue')
            }
        ]
    },
    {
        path: '/login',
        meta: {
            title: "登录",
        },
        component: () => import("../components/Login")
    },
    {
        path: '/admin',
        meta: {
            title: "管理员登录",
        },
        component: () => import("../components/Admin")
    },
    {
        path:'/company',
        meta:{
            title:"公司动态",
        },
        component:()=>import('../components/Views/Company.vue')
    
    },
    {
        path:'/excellentworks',
        meta:{
            title:"大神风采",
        },
        component:()=>import('../components/Views/ExcellentWorks.vue')
    
    },
    {
        path:'/aboutus',
        meta:{
            title:"关于我们",
        },
        component:()=>import('../components/Views/AboutUs.vue')
    }

]

export default routes;